<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var abc = prompt("请输入一个数组,用','隔开");
        var Arr = abc.split(",");
        document.write("这个数组是:" + Arr);
        var myArray=new Array();
        for (var j = 0; j < Arr.length; j++) {
            myArray[j] = parseInt(Arr[j]);
        } 
        for (var j = 0; j < myArray.length; j++) {
            for (var k = 0; k < myArray.length; k++) {
                if (myArray[k] > myArray[j]) {
                   var temp = myArray[j];
                    myArray[j] = myArray[k];
                    myArray[k] = temp;
                }
            }
        }
        document.write("<br>排序后的数组是:" + myArray);
    </script>
</head>
<body>
</body>
</html>
